#ifndef CCUSTOMTOOLBUTTON_H
#define CCUSTOMTOOLBUTTON_H

#include <QObject>
#include <QToolButton>

class CCustomToolButton : public QToolButton
{
    Q_OBJECT
public:
    CCustomToolButton(QWidget *parent = nullptr);
    CCustomToolButton(const QIcon &icon, const QString &text, const QString &tip = "", QWidget *parent = nullptr);


    virtual void mousePressEvent(QMouseEvent *e) override;

    virtual void mouseReleaseEvent(QMouseEvent *e) override;
    virtual void paintEvent(QPaintEvent *event) override;
    virtual void enterEvent(QEvent *) override;
    virtual void leaveEvent(QEvent *) override;


private:
    void Init();

private:
    bool m_bToggled;
    bool m_bHover;
};

#endif // CCUSTOMTOOLBUTTON_H
